﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/BackOffice.Master"
	AutoEventWireup="true" CodeBehind="Catalog.aspx.cs" Inherits="ASPItalia.ModelVirtualCasting.Web.Admin.CatalogPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Le modelle</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <script type="text/javascript" src="/Silverlight.js"></script>
    <script type="text/javascript">
    	function onSilverlightError(sender, args) {
    		var appSource = "";
    		if (sender != null && sender != 0) {
    			appSource = sender.getHost().Source;
    		}

    		var errorType = args.ErrorType;
    		var iErrorCode = args.ErrorCode;

    		if (errorType == "ImageError" || errorType == "MediaError") {
    			return;
    		}

    		var errMsg = "Unhandled Error in Silverlight Application " + appSource + "\n";

    		errMsg += "Code: " + iErrorCode + "    \n";
    		errMsg += "Category: " + errorType + "       \n";
    		errMsg += "Message: " + args.ErrorMessage + "     \n";

    		if (errorType == "ParserError") {
    			errMsg += "File: " + args.xamlFile + "     \n";
    			errMsg += "Line: " + args.lineNumber + "     \n";
    			errMsg += "Position: " + args.charPosition + "     \n";
    		}
    		else if (errorType == "RuntimeError") {
    			if (args.lineNumber != 0) {
    				errMsg += "Line: " + args.lineNumber + "     \n";
    				errMsg += "Position: " + args.charPosition + "     \n";
    			}
    			errMsg += "MethodName: " + args.methodName + "     \n";
    		}

    		throw new Error(errMsg);
    	}
    </script>

	<h2>Gestione modelle</h2>

    <div id="silverlightControlHost" style="width:100%;height:800px;">
        <object data="data:application/x-silverlight-2," type="application/x-silverlight-2" width="100%" height="100%">
		  <param name="source" value="/ClientBin/ASPItalia.ModelVirtualCasting.Silverlight.BackOffice.xap"/>
		  <param name="onError" value="onSilverlightError" />
		  <param name="background" value="white" />
		  <param name="minRuntimeVersion" value="5.0.60401.0" />
		  <param name="enableGpuAcceleration" value="true" />
          <param name="autoUpgrade" value="true" />
		  <p>Per far funzionare questa parte del backoffice, è necessario Silverlight!</p>
	    </object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>

</asp:Content>